package com.example.task;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author Lcyee
 * @Blog https://www.codeyee.com
 * @Date 2020/6/14
 * @Description 定时任务例子
 */

//@Component
public class TaskDemo {
    private static final Logger LOGGER = LoggerFactory.getLogger(TaskDemo.class);

    // 每5分钟执行一次
    @Scheduled(fixedDelay = 60000 * 5)
    public void updatePlayAuth() throws Exception {
        LOGGER.info("正在执行本轮定时任务");
        //....
        LOGGER.info("本轮任务执行完成");
    }
}
